package br.com.massai.controller.adapter;

import java.io.Serializable;

import br.com.massai.model.entity.Action;
import br.com.massai.model.entity.Function;

public class FunctionAdapter implements Serializable {

	private static final long serialVersionUID = -2315543711823220973L;

	private String acronym;
	private String description;
	private Action searchAction;
	private Action insertAction;
	private Action updateAction;
	private Action deleteAction;
	private Action printoutAction;
	private Function function;

	public FunctionAdapter() { }

	public FunctionAdapter(Function function) {
		this();
//		if(function != null){
//			this.acronym = function.getAcronym();
//			this.description = function.getDescription();
//			this.function = function;
//			for(Action a : function.getActions()){
//				if(a.getNameAction().equals(ActionFunctionality.SEARCH)) this.searchAction = a;
//				else if(a.getNameAction().equals(ActionFunctionality.INSERT)) this.insertAction = a;
//				else if(a.getNameAction().equals(ActionFunctionality.UPDATE)) this.updateAction = a;
//				else if(a.getNameAction().equals(ActionFunctionality.DELETE)) this.deleteAction = a;
//				else if(a.getNameAction().equals(ActionFunctionality.PRINTOUT)) this.printoutAction = a;
//			}
//		}
	}

	public String getDescription() {
		return description;
	}
	
	public void setDescription(String description) {
		this.description = description;
	}
	
	public Action getSearchAction() {
		return searchAction;
	}
	
	public void setSearchAction(Action searchAction) {
		this.searchAction = searchAction;
	}
	
	public Action getInsertAction() {
		return insertAction;
	}

	public void setInsertAction(Action insertAction) {
		this.insertAction = insertAction;
	}

	public Action getUpdateAction() {
		return updateAction;
	}
	
	public void setUpdateAction(Action updateAction) {
		this.updateAction = updateAction;
	}
	
	public Action getDeleteAction() {
		return deleteAction;
	}
	
	public void setDeleteAction(Action deleteAction) {
		this.deleteAction = deleteAction;
	}
	
	public Action getPrintoutAction() {
		return printoutAction;
	}
	
	public void setPrintoutAction(Action printoutAction) {
		this.printoutAction = printoutAction;
	}

	public String getAcronym() {
		return acronym;
	}

	public void setAcronym(String acronym) {
		this.acronym = acronym;
	}

	public Function getFunction() {
		return function;
	}

	public void setFunction(Function function) {
		this.function = function;
	}
}